package com.level2app.ui.wallet;

import com.level2app.R;
import com.level2app.adapter.TransactionsAdapter;
import com.level2app.base.BaseActivity;
import com.level2app.base.BaseViewModel;
import com.level2app.databinding.ActivityTransactionsListBinding;

import java.util.ArrayList;
import java.util.List;

public class TransactionsListActivity extends BaseActivity<ActivityTransactionsListBinding, BaseViewModel> {
    private TransactionsAdapter adapter;
    private List<String> data = new ArrayList<>();

    @Override
    protected BaseViewModel bindModel() {
        return getViewModel(this, BaseViewModel.class);
    }

    @Override
    protected void initInject() {
        getActivityComponent().inject(this);
    }

    @Override
    protected void initData() {
        initTitleBar(getString(R.string.transactions));
        for (int i = 0; i < 30; i++) {
            data.add("");
        }
        adapter = new TransactionsAdapter();
        binding.recyclerView.setAdapter(adapter);
        adapter.setEmptyViewEnable(true);
        adapter.setEmptyViewLayout(context, R.layout.transactions_empty_layout);
        adapter.submitList(data);
    }

    @Override
    protected void initClick() {
        super.initClick();
        binding.refreshLayout.setOnRefreshListener(refreshLayout -> {
            binding.refreshLayout.finishRefresh();
        });
        binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> {
            binding.refreshLayout.finishLoadMore();
        });
        adapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
        });
    }
}